IMG ?= fyl253711/kubehark-gateway:v1
SHELL := /bin/bash

fmt: ## Run go fmt against code.
	go fmt ./...

build:  ## Build manager binary.
	go build -o bin/manager main.go
build-linux:  ## Build manager binary.
	go mod tidy && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o bin/manager main.go

docker-build: build-linux  ## Build docker image with the manager.
	docker build -t ${IMG} .
docker-push: ## Build docker image with the manager.
	docker push  ${IMG}

run-dev: ## Run go fmt against code.
	go run main.go server \
    --port=8082 \
    --certfile=/Users/loganfang/go/src/gitee/kubehark/kubehark-gateway/example.com+5.pem \
    --keyfile=/Users/loganfang/go/src/gitee/kubehark/kubehark-gateway/example.com+5-key.pem \
    --clientId=example-app \
    --issuer=http://106.12.59.10:5556/dex \
    --secret=ZXhhbXBsZS1hcHAtc2VjcmV0 \
    --kubeconfig=/Users/loganfang/go/src/gitee/kubehark/kubehark-auth/bin/k8sconfig_dev \
    --rbacurl=http://106.12.59.10:32627/v1/oauth/


set-dev: ## Run go fmt against code.
    ./kubehark-client setup \
    --name=kubehark --oidc-client-id=example-app --oidc-issuer=http://106.12.59.10:5556/dex --oidc-secret=ZXhhbXBsZS1hcHAtc2VjcmV0 --server=https://106.12.59.10:31743

